package il.ac.biu.cs.grossmm.api.server;

/**
 * Represence a server component. Components are provided by a server framework
 * on request of other components. An object does not need to implement any
 * interface in order to be a component unless it have to use other components.
 */
public interface Component {
	/**
	 * Sets component container and initializes the component.
	 * 
	 * @param container
	 *            the component container
	 * @throws Exception
	 *             thrown if resource cannot be initialized
	 */
	void setComponentManager(ComponentManager container) throws Exception;

	/**
	 * Called when one of used components became invaled because of an
	 * exceptional situation
	 * 
	 * @param name
	 *            name of component
	 * @param e
	 *            the exception occured
	 * @throws Exception
	 */
	void aborted(Object hint, Exception e) throws Exception;
}
